package cn.com.huzo.model.entities.master;

import huzofw.model.entities.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.util.Date;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 员工主文件实体类
 *
 * @author 吴旭
 */
public class EmployeeEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = -2474189673359358419L;

    private Long EmployeeId;
    private String EmployeeNo;
    private String EmployeeName;
    private String Gender;
    private Date Birthday;
    private String IdentityCard;
    private String Telephone;
    private Integer DepartmentId;
    private String DepartmentName;
    private Integer JobId;
    private String JobName;
    private Date HiredDate;
    private Date DimissionDate;
    private String EmployeeType;
    private String Description;
    /* 检索过滤标记 1：系统成员 2：用户组 */
    private Short FilterFlag;
    /* 用户组ID */
    private Long UserGroupId;
    private Long CatalogueId;            // 用来做目录改变

    public Long getEmployeeId() {
        return EmployeeId;
    }

    public String getEmployeeNo() {
        return EmployeeNo;
    }

    public String getEmployeeName() {
        return EmployeeName;
    }

    public String getGender() {
        return Gender;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Date getBirthday() {
        return Birthday;
    }

    public String getIdentityCard() {
        return IdentityCard;
    }

    public String getTelephone() {
        return Telephone;
    }

    public Integer getDepartmentId() {
        return DepartmentId;
    }

    public String getDepartmentName() {
        return DepartmentName;
    }

    public Integer getJobId() {
        return JobId;
    }

    public String getJobName() {
        return JobName;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Date getHiredDate() {
        return HiredDate;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Date getDimissionDate() {
        return DimissionDate;
    }

    public String getEmployeeType() {
        return EmployeeType;
    }

    public String getDescription() {
        return Description;
    }

    public Short getFilterFlag() {
        return FilterFlag;
    }

    public Long getUserGroupId() {
        return UserGroupId;
    }

    public void setEmployeeId(Long EmployeeId) {
        this.EmployeeId = EmployeeId;
    }

    public void setEmployeeNo(String EmployeeNo) {
        this.EmployeeNo = EmployeeNo;
    }

    public void setEmployeeName(String EmployeeName) {
        this.EmployeeName = EmployeeName;
    }

    public void setGender(String Gender) {
        this.Gender = Gender;
    }

    public void setBirthday(Date Birthday) {
        this.Birthday = Birthday;
    }

    public void setIdentityCard(String IdentityCard) {
        this.IdentityCard = IdentityCard;
    }

    public void setTelephone(String Telephone) {
        this.Telephone = Telephone;
    }

    public void setDepartmentId(Integer DepartmentId) {
        this.DepartmentId = DepartmentId;
    }

    public void setDepartmentName(String DepartmentName) {
        this.DepartmentName = DepartmentName;
    }

    public void setJobId(Integer JobId) {
        this.JobId = JobId;
    }

    public void setJobName(String JobName) {
        this.JobName = JobName;
    }

    public void setHiredDate(Date HiredDate) {
        this.HiredDate = HiredDate;
    }

    public void setDimissionDate(Date DimissionDate) {
        this.DimissionDate = DimissionDate;
    }

    public void setEmployeeType(String EmployeeType) {
        this.EmployeeType = EmployeeType;
    }

    public void setDescription(String Description) {
        this.Description = Description;
    }

    public void setFilterFlag(Short FilterFlag) {
        this.FilterFlag = FilterFlag;
    }

    public void setUserGroupId(Long UserGroupId) {
        this.UserGroupId = UserGroupId;
    }

    public Long getCatalogueId() {
        return CatalogueId;
    }

    public void setCatalogueId(Long CatalogueId) {
        this.CatalogueId = CatalogueId;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof EmployeeEntity)) {
            return false;
        }

        final EmployeeEntity that = (EmployeeEntity) o;

        return new EqualsBuilder()
                .append(this.getEmployeeId(), that.getEmployeeId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + this.getEmployeeId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
